<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('construction_diaries', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->default(0)->index();
            $table->unsignedBigInteger('user_id')->index()->default(0)->comment('记录人');
            $table->date('date')->nullable()->comment('日期');
            $table->string('day_weather')->default('/')->comment('白天天气');
            $table->string('day_temperature')->default('/')->comment('白天温度');
            $table->string('day_wind')->default('/')->nullable()->comment('白天风力');
            $table->string('night_weather')->default('/')->comment('夜间天气');
            $table->string('night_temperature')->default('/')->comment('夜间温度');
            $table->string('night_wind')->default('/')->nullable()->comment('夜间风力');
            $table->string('work_content')->default('/')->comment('施工内容');
            $table->string('progress')->default('/')->comment('工程进度');
            $table->string('quality_safety')->default('/')->comment('安全情况');
            $table->string('materials')->default('/')->comment('材料使用');
            $table->string('equipment')->default('/')->comment('设备运行');
            $table->string('problems')->nullable()->default('/')->comment('存在问题');
            $table->string('solutions')->nullable()->default('/')->comment('解决措施');
            $table->string('next_day_plan')->nullable()->default('/')->comment('次日计划');
            $table->string('day_remarks')->nullable()->default('/')->comment('备注');
            $table->string('night_remarks')->nullable()->default('/')->comment('备注');
            $table->string('remarks')->nullable()->default('/')->comment('备注');
            $table->string('files')->nullable()->default('')->comment('施工过程中照片');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('construction_diaries');
    }
};
